package eva.savant.business.global.view

import eva.savant.businessobject.gl.Departamento
import eva.savant.businessobject.gl.Pais
import eva.savant.core.view.Maestro

import javax.faces.bean.ManagedBean
import javax.faces.bean.SessionScoped
import javax.annotation.PostConstruct

@SessionScoped
@ManagedBean(name = 'IMDepartamento')
public class IMDepartamento extends Maestro {

  def lsPais

  @PostConstruct
  public void cleanEntity() {

    entity= new Departamento(); init()

    entity.pais= new Pais()

    lsPais= entityService.find('select m from ' + Pais.canonicalName + ' m where m.operacionId > 0')
  }

  public List findLsEntity() {

    return entityService.find('select m from ' + Departamento.canonicalName + ' m where m.operacionId > 0')
  }

}
